package svc

import (
	"inventory-system/api/internal/config"
	"inventory-system/invenrpc/invenrpcclient"
	"net/http"

	"github.com/zeromicro/go-zero/zrpc"
)

type ServiceContext struct {
	Config   config.Config
	InvenRpc invenrpcclient.Invenrpc
}

func (c ServiceContext) UserAgentMiddleware(next http.HandlerFunc) http.HandlerFunc {
	return func(writer http.ResponseWriter, request *http.Request) {

	}
}

func NewServiceContext(c config.Config) *ServiceContext {
	return &ServiceContext{
		Config:   c,
		InvenRpc: invenrpcclient.NewInvenrpc(zrpc.MustNewClient(c.InvenRpc)),
	}
}
